import areaData from './area';

export const makeAreaMap = () => {
  const map = {};

  const adapter = (data) => {
    data?.forEach((item) => {
      map[item.value] = item.label;
      if (item?.children) {
        adapter(item.children);
      }
    });
  };

  adapter(areaData);
  return map;
};

const areaMap = makeAreaMap();

export default areaMap;
